using System;
using System.Collections.Generic;
using System.Text;

using PickGold;
using PickGold.Database;

namespace PickGold.Entities.View
{
    public abstract partial class CRadixSuraInfo : CBaseTable
    {
        //
        public const string ENTITY_KEY = "sura_id";
        public const string ENTITY_SYMBOL = "sura_name";
        //
        public const string ICO_MIME = "ico_mime";
        public const string ITEM_NOTE = "item_note";
        //
        private SRadixSuraInfo _ = null;
        //
        public CRadixSuraInfo(string name) : base(name) { }
        public CRadixSuraInfo(string name, string alias) : base(name, alias) { }
        public CRadixSuraInfo(CDatabase db, string name) : base(db, name) { }
        public CRadixSuraInfo(CDatabase db, string name, string alias) : base(db, name, alias) { }
        //
        protected override void SetSchema()
        {
            this.SetSchema(new SRadixSuraInfo());
        }
        protected void SetSchema(SRadixSuraInfo s)
        {
            this._ = s;
            base.SetSchema(s);
        }
        //
        protected override void PreInitSchema()
        {
            base.PreInitSchema();
            this._DataTable.Columns.Add(ICO_MIME, typeof(long)).DefaultValue = this._.IcoMime;
            this._DataTable.Columns.Add(ITEM_NOTE, typeof(string)).MaxLength = 1024;
        }
        //
        #region Property
        //
        public long IcoMime
        {
            set
            {
                this._.IcoMime = value;
                this.SetValue(ICO_MIME, value);
            }
            get
            {
                return this._.IcoMime;
            }
        }
        //
        public string ItemNote
        {
            set
            {
                this._.ItemNote = value;
                this.SetValue(ITEM_NOTE, value);
            }
            get
            {
                return this._.ItemNote;
            }
        }
        //
        #endregion
        //
        public override bool MoveTo(int position)
        {
            if (!base.MoveTo(position))
                return false;
            this._.IcoMime = this.GetValue<long>(ICO_MIME);
            this._.ItemNote = this.GetValue<string>(ITEM_NOTE);
            return true;
        }
        //
    }
    //
    public class SRadixSuraInfo : SBaseTable
    {
        //
        public long IcoMime = -1;
        public string ItemNote = null;
        //
    }
    //
}
//
